/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.fiu.accesslog.filter;

import edu.fiu.accesslog.SingleAccessLog;
import nl.bitwalker.useragentutils.Browser;

/**
 *
 * @author Hasan Mahmud
 * @date Jul 12, 2012
 */
public class BotFilters extends Filters
{
        private static BotFilters singletonInstance = null;
         public static synchronized BotFilters getInstance()
        {
                if (singletonInstance == null)
                {
                        singletonInstance = new BotFilters();
                }

                return singletonInstance;
        }
        
        @Override
        public boolean isFiltered(SingleAccessLog saLog)
        {
               if( saLog.getUserAgent() != null && saLog.getUserAgent().getBrowser().getGroup() == Browser.BOT)
               {
                       return true;
               }
               
               return false;
        }

}
